package com.wicket.okrapp.biz.service.nb;

import cn.hutool.core.bean.BeanUtil;
import com.wicket.okrapp.common.baseinfo.BaseInfoDO;
import com.wicket.okrapp.common.baseinfo.BaseInfoHolder;
import com.wicket.okrapp.common.util.CommonFunctionHelper;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.stereotype.Service;
import com.wicket.okrapp.biz.service.dto.req.ImplementFourthReceivingFieldReqDto;
import com.wicket.okrapp.biz.service.dto.res.ImplementFourthReceivingFieldRespDto;
import com.wicket.okrapp.biz.service.dto.req.ImplementBizPublicFieldPushMemoryReqDto;
import com.wicket.okrapp.biz.service.dto.res.ImplementBizPublicFieldPushMemoryRespDto;
import com.wicket.okrapp.biz.service.dto.req.ObtainReceiveOutFieldReqDto;
import com.wicket.okrapp.biz.service.dto.res.ObtainReceiveOutFieldRespDto;
import com.wicket.okrapp.biz.service.dto.req.ImplementSendMsgReceiverAcceptFieldReqDto;
import com.wicket.okrapp.biz.service.dto.res.ImplementSendMsgReceiverAcceptFieldRespDto;

/**
 * @author ： 手工接入方法
 * @since 2022/5/28 15:32
 *
 *
 * @version 1.0
 */
@Service
public class NbCommunication {
/**
      * code:receptionService
      * name:M3用于接收数据集入参
      * desc:undefined
      * gen by moon at 1/26/2024, 4:46:57 AM
      * 
      **/
     @Trace(operationName = "M3用于接收数据集入参")
     @Tags({@Tag(key = "参数",value = "arg[0]"),
     @Tag(key = "返回值",value = "returnedObj")})
      public ImplementFourthReceivingFieldRespDto implementFourthReceivingField(ImplementFourthReceivingFieldReqDto reqDto) {
         return BeanUtil.toBean(reqDto, ImplementFourthReceivingFieldRespDto.class);
      }
/**
      * code:publicFieldCache
      * name:M3执行业务应用公共字段推送内存（特殊方法）
      * desc:undefined
      * gen by moon at 1/26/2024, 4:47:28 AM
      * 
      **/
     @Trace(operationName = "M3执行业务应用公共字段推送内存（特殊方法）")
     @Tags({@Tag(key = "参数",value = "arg[0]"),
     @Tag(key = "返回值",value = "returnedObj")})
      public ImplementBizPublicFieldPushMemoryRespDto implementBizPublicFieldPushMemory(ImplementBizPublicFieldPushMemoryReqDto reqDto) {
         BaseInfoDO domain = new BaseInfoDO();
         if(BaseInfoHolder.contextHolder.get()!=null){
             BeanUtil.copyProperties(BaseInfoHolder.contextHolder.get().getBaseInfo(),domain);
             BaseInfoHolder.contextHolder.remove();
         }
         if(reqDto.getSpaceId()!=null){
             domain.setSpecSpaceId(reqDto.getSpaceId());
         }

         if(reqDto.getCreateInductionId()!=null){
             domain.setSpecInductionRecordId(reqDto.getCreateInductionId());
         }

         if(reqDto.getAppId()!=null){
             domain.setSpecAppId(reqDto.getAppId());
         }

         if(reqDto.getHighestOrgID()!=null){
             domain.setSpecHighestOrgID(reqDto.getHighestOrgID());
         }

         if(reqDto.getUserId()!=null){
             domain.setSpecUserId(reqDto.getUserId());
         }

         if(reqDto.getOriginalRoleMemberId()!=null){
             domain.setSpecOriginalRoleMemberId(reqDto.getOriginalRoleMemberId());
         }

         CommonFunctionHelper.setBaseInfoToLocal(domain);
         return new ImplementBizPublicFieldPushMemoryRespDto();
     }
/**
      * code:receptionService
      * name:M3约定高中基层回退操作消息模板标识
      * desc:undefined
      * gen by moon at 2/13/2024, 10:42:55 AM
      *
      **/
     @Trace(operationName = "M3约定高中基层回退操作消息模板标识")
     @Tags({@Tag(key = "参数",value = "arg[0]"),
     @Tag(key = "返回值",value = "returnedObj")})
      public ObtainReceiveOutFieldRespDto obtainReceiveOutField(ObtainReceiveOutFieldReqDto reqDto) {
         return BeanUtil.toBean(reqDto, ObtainReceiveOutFieldRespDto.class);

      }
/**
      * code:receptionService
      * name:M3接收字段
      * desc:undefined
      * gen by moon at 2/13/2024, 10:43:12 AM
      *
      **/
     @Trace(operationName = "M3接收字段")
     @Tags({@Tag(key = "参数",value = "arg[0]"),
     @Tag(key = "返回值",value = "returnedObj")})
      public ImplementSendMsgReceiverAcceptFieldRespDto implementSendMsgReceiverAcceptField(ImplementSendMsgReceiverAcceptFieldReqDto reqDto) {
         return BeanUtil.toBean(reqDto, ImplementSendMsgReceiverAcceptFieldRespDto.class);
      }
  //手工接入方法
}
